<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    isActive: Boolean,
    text: String,
  },
});
</script>

<template>
  <view class="tab-item">
    <view class="tab-item-line" v-if="isActive" />
    <view class="tab-item-text" :class="{ 'tab-item-active': isActive }">
      {{ text }}
    </view>
  </view>
</template>

<style lang="scss">
.tab-item {
  position: relative;
  display: flex;
  justify-content: center;

  .tab-item-line {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 40rpx;
    height: 8rpx;
    border-radius: 4rpx;
    background: linear-gradient(90deg, #67d752, #1db476);
    transform: translateX(-50%);
  }

  .tab-item-text {
    position: relative;
    font-size: 30rpx;
    color: #666666;
    line-height: 60rpx;
  }

  .tab-item-active {
    font-size: 36rpx;
    color: #333333;
    font-weight: bold;
  }
}
</style>